package com.lyon.custom.autoconfiguration;

import com.lyon.custom.core.LyonConfigManager;
import com.lyon.custom.core.refresh.LyonConfigAutoRefresh;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @author LeeYan9
 * @since 2021-12-03
 */
@ConditionalOnBean(LyonConfigManager.class)
public class LyonConfigRefreshAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    LyonConfigAutoRefresh configAutoRefresh(LyonConfigManager configManager) {
        return new LyonConfigAutoRefresh(configManager);
    }

}
